import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * 非递增顺序的最小子序列
 *
 * @USER: Administrator
 * @DATE: 2024/10/5 下午7:13
 * @VERSION: 1.0.0
 */
public class LC1403 {
    public static void main(String[] args) {

    }

    public List<Integer> minSubsequence(int[] nums) {
        int sum = 0;
        for (int num : nums) {
            sum += num;
        }
        Arrays.sort(nums);
        List<Integer> res = new ArrayList<>();
        int sum1 = 0;
        for (int i = nums.length-1; i >= 0; i--) {
            sum1 += nums[i];
            res.add(nums[i]);
            if (sum1 > sum/2) {
                break;
            }
        }
        return res;
    }

}
